/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.javahispano.javacup.modelo;

/**
 *
 * @author fabnun
 */
public class TrayectoriaSuelo extends AbstractTrayectoria {

    private final static double k = 4;
    private final double xStop;

    public TrayectoriaSuelo(double vx0, double x0) {
        super(vx0, 0, x0, 0);
        xStop = getX(t0);
    }

    public double getX(double t) {
        if (t > t0) {
            return xStop;
        } else {
            return vx0 * t - k * t * t /2 + x0;
        }
    }

    public double getY(double t) {
        return 0;
    }

    public double getT0() {
        return vx0 / k;
    }
}
